﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="OrderItems.ascx.cs" Inherits="webapp4U.UI.Controls.Title" %>
<%@ Import Namespace="webapp4U" %>


 
    <table border="0" width="100px" cellpadding="0"  cellspacing="0" align="center">
    <tr>
        <td style="padding-top:5pt;" align="center">
            <asp:GridView runat="server" Width="700px" HorizontalAlign="Center" 
                ID="GridViewItem" 
                DataSourceID="ItemDataSource" 
                AutoGenerateColumns="false" 
                AllowPaging="True" 
                AllowSorting="True" 
                PagerSettings-Mode="NumericFirstLast"
                GridLines="none">
                <Columns>
                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px"
                        HeaderText="Delete">
                        <HeaderTemplate>
                            <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server" type="checkbox" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox runat="server" ID="chkSelect" ToolTip='<%# Eval("ProductID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Sản phẩm" 
                        HeaderStyle-Width="200" ItemStyle-Width="200" ItemStyle-Height="40"
                        HeaderStyle-HorizontalAlign="Left"
                        ItemStyle-HorizontalAlign ="left">
                        <ItemTemplate>
                            <%# Eval("Title") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Giá bán(VND)" 
                        HeaderStyle-Width="100" ItemStyle-Width="100"
                        HeaderStyle-HorizontalAlign="Left"
                        ItemStyle-HorizontalAlign ="left">
                        <HeaderTemplate><%=ResourceManager.GetString("Product_Price")%></HeaderTemplate>
                        <ItemTemplate>
                              <span style="font-weight:normal"><%# Formatter.FormatMoney((Decimal)Eval("UnitPrice"))%> VND</span>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                        HeaderText="Delete">
                        <HeaderTemplate><%=ResourceManager.GetString("Product_Quantity")%></HeaderTemplate>
                        <ItemTemplate>
                            <%# Eval("Quantity") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                </Columns>
                <EmptyDataTemplate>
                    <table align="center" width="100%" border="0" bgcolor="#ffffcc" bordercolorlight="#0099cc"  bordercolor="#0099cc">
                        <tr>
                            <td height="50" align="center">
                                <div align="center" id="EmptyData"><%=ResourceManager.GetString("Product_ShoppingCartEmpty")%></div>
                            </td>   
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:GridView>            
        </td>
    </tr>
    </table>



 <asp:ObjectDataSource
    ID="ItemDataSource"
    runat="server"
    SelectMethod="GetOrderItemsByOrderID"
    TypeName="webapp4U.BOL.OrderItems">
    <SelectParameters>
        <asp:QueryStringParameter DefaultValue="-1" Name="OrderID" QueryStringField="OrderID" Type="int32" />
    </SelectParameters>
</asp:ObjectDataSource>